package com.an.homework;

public class HomeWork_7 {
    public static void main(String[] args) {
    Color c=Color.BLACK;

    switch(c){
        case RED:
            c.show();
            break;
        case BLUE:
            c.show();
            break;
        case GREEN:
            c.show();
            break;
        case BLACK:
            c.show();
            break;
        case YELLOW:
            c.show();
            break;
        default:
            System.out.println("错误");
            break;
    }

    }

}

enum Color implements Usb{
    RED(255,0,0),
    BLUE(0,0,255),
    BLACK(0,0,0),
    YELLOW(255,255,0),
    GREEN(0,255,0);

    public  int redvalue;
 public   int greenvalue;
public   int bluevalue;
public void show(){
    System.out.println("redvalue="+redvalue+"\tgreenvalue="+greenvalue+"\tbluevalue="+bluevalue);
}

    Color(int redvalue, int greenvalue, int bluevalue) {
        this.redvalue = redvalue;
        this.greenvalue = greenvalue;
        this.bluevalue = bluevalue;
    }
}

interface Usb{
    public void show();
}
